[ASAN] sysroot: Squash a leak in lockfile acquisition
authorColin Walters <walters@verbum.org>
Thu, 8 Dec 2016 15:01:35 +0000 (10:01 -0500)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 8 Dec 2016 16:18:19 +0000 (16:18 +0000)
I installed `parallel` in my dev container, which got me
the sysroot locking tests, which caught this leak when
built with ASAN.

Closes: #623
Approved by: jlebon

src/libostree/ostree-sysroot.c

index 70ce15670f9918b775595320b740ffa8cc002420..f50e34bdde654c65aeaea13a397a34cd2f96123c 100644 (file)
@@ -1323,7 +1323,7 @@ ostree_sysroot_try_lock (OstreeSysroot         *self,
                          GError               **error)
 {
   gboolean ret = FALSE;
-  GError *local_error = NULL;
+  g_autoptr(GError) local_error = NULL;
 
   if (!ensure_sysroot_fd (self, error))
     goto out;
@@ -1338,7 +1338,7 @@ ostree_sysroot_try_lock (OstreeSysroot         *self,
         }
       else
         {
-          g_propagate_error (error, local_error);
+          g_propagate_error (error, g_steal_pointer (&local_error));
           goto out;
         }
     }